package ar.edu.unlu.sistemas.p2p.android;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainMenuActivity extends Activity implements OnClickListener {
	
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.menu);
        Button btn = (Button)findViewById(R.id.button_p2p_functions);
        btn.setOnClickListener(this);
        btn = (Button)findViewById(R.id.button_bd_query);
        btn.setOnClickListener(this);
        btn = (Button)findViewById(R.id.button_bd_insert);
        btn.setOnClickListener(this);
        btn = (Button)findViewById(R.id.button_file_handle);
        btn.setOnClickListener(this);
        btn = (Button)findViewById(R.id.button_exc_query);
        btn.setOnClickListener(this);
        btn = (Button)findViewById(R.id.button_preferences);
        btn.setOnClickListener(this);
    }

    public void onClick(View v) {
    	switch (v.getId()) {
			case R.id.button_p2p_functions:
				startActivity(new Intent(MainMenuActivity.this,SomeActionActivity.class));
				break;
			case R.id.button_bd_query:
				startActivity(new Intent(MainMenuActivity.this,IndexActivity.class));
				break;
			case R.id.button_bd_insert:
				startActivity(new Intent(MainMenuActivity.this,InsertActivity.class));
				break;
			case R.id.button_file_handle:
				startActivity(new Intent(MainMenuActivity.this,FileActivity.class));
				break;
			case R.id.button_exc_query:
				startActivity(new Intent(MainMenuActivity.this,QueryActivity.class));
				break;
			case R.id.button_preferences:
				startActivity(new Intent(MainMenuActivity.this,PreferencesActivity.class));
				break;
			default:
				break;
    	}
    }
    
}
